package commands;

import core.GameParticipant;
import core.GameParticipantRegistry;

/**
 * Represents a user's yes/no vote on a particular <code>Measure</code>.
 */
public class VoteCommand extends Command
{
	public VoteCommand() {
	}

	public VoteCommand(int v) {
		vote = v;
	}

	public net.StateUpdate execute() throws CommandException
	{
		super.execute();
		GameParticipant gp = GameParticipantRegistry.get();
		gp.notifyOfVote(player, vote);
		return null;
	}

	public int getVote() {
		return vote;
	}

	public void setVote(int vote) {
		this.vote = vote;
	}

	private int vote;
}